function slider (id) {
	var currentPosition = 0;
	var slideWidth = 460;
	var slides = $(id+' .slide');
	var numberOfSlides = slides.length;
	$(id+' .slidesContainer').css('overflow', 'hidden');
	slides.wrapAll('<div class="slideInner"></div>').css({
		'float' : 'left',
		'width' : slideWidth
	});
	$(id+' .slideInner').css('width', slideWidth * numberOfSlides);	
	$(id+' .slideshow')
		.prepend('<span class="control leftControl">Clicking moves left</span>')
		.append('<span class="control rightControl">Clicking moves right</span>');
	manageControls(currentPosition);
	$(id+' .control').bind('click', function(){
		currentPosition = ($(this).attr('class')=='control rightControl') ? currentPosition+1 : currentPosition-1;
		manageControls(currentPosition);
		$(id+' .slideInner').animate({
			'marginLeft' : slideWidth*(-currentPosition)
		});
	});
	
	function manageControls(position){
		if (position == 0){
			$(id+' .leftControl').hide()
		} else {
			$(id+' .leftControl').show()
		}		
		if (position == numberOfSlides-1){
			$(id+' .rightControl').hide()
		} else {
			$(id+' .rightControl').show()
		}
	}
}